﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Collections;
using System.Collections.Generic;

namespace HelloMVC.Model
{
    public class AgileIndexPageModel
    {
        [UIHint("IssueCard")]
        public IList<Issue> IssueList { get; set; }
    }

    public class Issue : BaseModel
    {
        public Int32 ProjectId { get; set; }
        public Int32 VersionId { get; set; }
        public Int32 ComponentId { get; set; }
        public Int32 ParentId { get; set; }
        public String ProjectKey { get; set; }

        [DisplayName("Summary")]
        [Required]
        public String Summary { get; set; }
        [DisplayName("Version")]
        [Autocomplete(Name = "version", Controller = "Issue", DependentEleId="ProjectId")]
        public String Version { get; set; }
        [DisplayName("Project")]
        [Autocomplete(Name = "project", Controller="Issue")]
        public String Project { get; set; }
        [DisplayName("Component")]
        [Autocomplete(Name="component", Controller="Issue", DependentEleId="ProjectId")]
        public String Component { get; set; }
        [DisplayName("Original Estimate")]
        public float? OriginalEstimate { get; set; }
        [DisplayName("Environment")]
        public String Environment { get; set; }
        [DisplayName("Description")]
        public String Description { get; set; }
        [DisplayName("Remaining")]
        public float? Remaining { get; set; }
        [DisplayName("Time Spent")]
        public float? TimeSpent { get; set; }
        [DisplayName("Status")]
        public String Status { get; set; }
        [DisplayName("Assignee")]
        public String Assignee { get; set; }
        [DisplayName("Theme")]
        public String Theme { get; set; }
        [DisplayName("Sub Theme")]
        public String SubTheme { get; set; }
        [DisplayName("Story Points")]
        public float? StoryPoints { get; set; }
        [DisplayName("Issue Type")]
        public String Type { get; set; }
        [DisplayName("Priority")]
        public String Priority { get; set; }
        [DisplayName("Internal Priority")]
        public String InternalPriority { get; set; }
        [DisplayName("Internal Complexity")]
        public String InternalComplexity { get; set; }
        [DisplayName("Risk Assessment")]
        public String RiskAssessment { get; set; }
    }

    public class BoardData
    {

        public String ProjectName { get; set; }
        public Int32 ProjectId { get; set; }
        public String BoardName { get; set; }
        public String BoardAction { get; set; }
        public Int32 BoardId { get; set; }
    }

    public class TaskboardData : BoardData
    {
        [UIHint("StepFamilies")]
        public IList<StepFamily> StepFamilies { get; set; }
        public StepFamily OthersIssue { get; set; }
    }
    
    public class StepFamily
    {
        public Issue Self { get; set; }
        public IList<Issue> ToDo { get; set; }
        public IList<Issue> InProgress { get; set; }
        public IList<Issue> Done { get; set; }
        public Int32 SubTotal { get { return ToDo.Count + InProgress.Count + Done.Count; } }
    }

    public class IssueQuery : Issue
    {
        public Int32 Start { get; set; }
        public Int32 Length { get; set; }
    }
}
